<template>
    <div>
      <a :href="url">跳转到{{ urlName }}</a>
      <br>
      <button @click="changeFn('https://www.taobao.com','淘宝')">跳转到淘宝</button>
      <button @click="changeFn('https://www.jd.com','京东')">跳转到京东</button>
      <button @click="changeFn('https://www.pdd.com','pdd')">跳转到拼多多</button>
      <button @click="changeFn('https://www.wph.com','唯品会')">跳转到唯品会</button>
    </div>
  </template>
  
  <script>
  export default {
    data(){
      return{
        url:'https://www.baidu.com',
        urlName: '百度'
      }
    },
      methods:{
        changeFn(url, urlName){
          this.url = url
          this.urlName = urlName 
        }
  }
  }
  </script>
  
  <style>
  
  </style>